/**
 * @Author DengJia
 * @Date 2021/7/29 21:48
 * @Description
 */

public class EqualsDemo {
    public static void main(String[] args) {
        Value v1 = new Value();
        Value v2 = new Value();

        v1.i = v2.i = 100;
        System.out.println(v1.equals(v2));

    }
}

class Value {
    int i;

    @Override
    public boolean equals(Object obj) {
        Value thisValue = this;
        Value objValue = (Value) obj;
        return thisValue.i == objValue.i;
    }
}
